package com.ccc.mqtt.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author superC
 * @version 1.0.0
 * @date 2023/6/19
 */

@SpringBootApplication
public class MqttServerApplication implements CommandLineRunner {
    protected static final Logger logger = LoggerFactory.getLogger(MqttServerApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(MqttServerApplication.class, args);
        logger.info("\r\n" +
                "*********************************************************************\r\n" +
                "\r\n" +
                "**********************启动ccc-mqtt-server系统已完成*************************\r\n" +
                "\r\n" +
                "*********************************************************************");

    }

    @Override
    public void run(String... args) throws Exception {
        // 启动MQTT监听端口  1883
        int port = 1883;
        NettyMqttServerThread nettyMqttServerThread = new NettyMqttServerThread(port);
        nettyMqttServerThread.start();
    }
}
